12.3 Obtain the collection exchange rate (system real-time)
#Brief description: Get the collection exchange rate interface (system real-time)
- Request method: POST
- Request interface: https://gateway-domain/wallet-trade-merchant/v1/utils/rate/receive
- Request media type (JSON data format)Content-Type: application/json
Query parameters
| Parameter name | Type | Required | Parameter meaning | Parameter description |
|---|---|---|---|---|
key | string | Yes | Merchant key | apiKey |
currency | string | Yes | Currency (order currency) | Example: CNY |
userCurrency | string | Yes | User’s actual received currency | Example: USDT |
sign | string | Yes | md5 signature | For details, see Signature Algorithm (Document 2) |
Request json sample
{
"key": "9yUreYgTRtit39Dy",
"currency": "CNY",
"userCurrency": "USDT",
"sign":"dbc72adf640a82e0b21f98c50afb2881"
}
Return value
| Parameter name | Type | Parameter meaning | Parameter description |
|---|---|---|---|
code | int | Request status | Communication status Successful return: 0, others indicate failure |
success | boolean | Success Status | true Success |
message | string | Description | |
data | json | Parameters | Please refer to the following description for parameters |
Return to Example
{
"code": 0,
"success": true,
"message": null,
"data": {
"baseCurrency": "USDT",
"quoteCurrency": "CNY",
"tradePair": "USDT/CNY",
"rate": 6.68138724,
"costRate": 6.68138724,
"costReverseRate": 0.14966951683524932,
"exchangeAction": "SELL",
"quoteExpression": "1USDT≈6.6813CNY",
"baseAmount": "14.966951",
"quoteAmount": "100"
}
}
data parameter description
| Parameter name | Type | Parameter meaning | Parameter description |
|---|---|---|---|
baseCurrency | string | Base Currency | |
quoteCurrency | string | Quote Currency | |
tradePair | string | Trading Pair | |
rate | string | Price | |
costRate | number | Calculate price ( FROM x rate = TO ) | |
costReverseRate | number | Calculate the price in reverse (TO x rate = FROM ) | |
exchangeAction | enum | Transaction Type | BUY:Buy| SELL: Sell |
quoteExpression | string | Exchange rate expression | Expression in quotation form |
baseAmount | string | Base Amount | Example Base Amount |
quoteAmount | string | Quotation amount | Sample quotation amount |